export PS1=$'\\n\\\n[\\[\\e[32m\\]\\u\\[\\e[0m\\]\\\n@\\\n\\[\\e[35m\\]\\H \\\n\\[\\e[36;1m\\]\\w\\\n\\[\\e[0m\\]] \\\n$(RETVAL="$?"; echo -en "\\e[33m{$(date +%H:%M:%S)} ";\n  if [ "$RETVAL" -eq 0 ];then\n echo -en "\\[\\e[32m\\]($RETVAL)"\n else\n echo -en "\\[\\e[31;1m\\a\\]($RETVAL)"\n fi)\\n\\\n\\[\\e[0;1;34m\\]\\$ \\[\\e[0m\\]'
log_file=/etc/logs/history.log
log_dir=/etc/logs
if [ ! -f $log_file ]; then
mkdir -p $log_dir
touch $log_file
chmod 777 $log_file
fi
 if ! test -z  "$BASH_EXECUTION_STRING" ; then
         echo "===== $(date "+%F  %T") $USER nologin cmd:   $BASH_EXECUTION_STRING" >>$log_file
 elif  shopt -q login_shell ; then
         echo "=== $(date "+%F  %T") new login ${SSH_TTY:5} $USER from ${SSH_CLIENT%% *}">>$log_file
 else
         echo "=== $(date "+%F  %T") su ${SSH_TTY:5} $USER from ${SSH_CLIENT%% *}">>$log_file
 fi
export PROMPT_COMMAND='{ date "+%y-%m-%d %T ##### $(who am i |awk "{print \$1\" \"\$2\" \"\$5}") #### $(pwd) #### $(history 1 | { read x cmd; echo "$cmd"; })"; } >> $log_file'



alias ll='ls -althrSF'
alias df='df -lTh'
alias cp='cp -f'
alias mv='mv -f'
alias de='de(){ docker exec -it $1 bash; };de'
alias dp='docker ps -a'
alias vi=vim
alias pz='iostat && free -h'
alias hqgw='wget -4qO- http://whatismyip.akamai.com/'
alias hqgw1='curl myip.ipip.net'
alias hqgw2='curl ip.cip.cc'
alias hqgw3='curl ifconfig.me'
alias azjc='yum install unzip git wget bash-completion lvm2 net-tools rsync vim tmux sysstat mtr lsof telnet git lrzsz tree tcpdump curl mlocate poppler-utils cifs-utils nfs-utils rpcbind bzip2 iptables-services iotop  traceroute epel-release gcc pcre-devel openssl openssl-devel -y || apt-get install unzip git wget bash-completion lvm2 net-tools rsync vim tmux sysstat iftop lsof telnet git lrzsz tree tcpdump curl mlocate poppler-utils cifs-utils  rpcbind bzip2  iotop  traceroute  gcc  openssl nfs-kernel-server nfs-common -y'
alias azy='yum install -y vim curl telnet wget net-tools bash-completion git rsync lrzsz mtr tmux lsof unzip tcpdump curl  iptables-services  traceroute bind-utils sysstat tzdata'
alias aza='apt-get update && apt-get install -y  unzip git wget bash-completion lvm2 net-tools traceroute dnsutils rsync vim tmux sysstat  lsof telnet git lrzsz  tcpdump  curl   tzdata'
